#ifndef SUBTASKTABLE_H
#define SUBTASKTABLE_H

#include <QObject>
#include <QTableWidget>
#include <QHeaderView>
#include <QDebug>
#include <QMessageBox>
#include "taskitem.h"
#include <QLabel>
#include <map>
#include "ndb.h"


class subTaskTable : public QObject
{
    Q_OBJECT
public:
    enum {STATE, ID, NAME, TOMATO, ACHIEVE};
    QPixmap m_pix_add;
    QPixmap m_pix_delete;
    QPixmap m_pix_ready;
    QPixmap m_pix_not_ready;

    int m_currentTaskId;


public:
    QTableWidget *m_table;

public:
    explicit subTaskTable(QObject *parent = nullptr);
    explicit subTaskTable(QTableWidget *table, QObject *parent = nullptr);

    void showSubTask(taskItem &task);
    void setCurrentSubTaskTable(taskItem &taskitem);


    void addSubTask(int newRow, const subTask &subtask);

signals:
    void selectCurrentSubTask(const subTask &subtask);
};

#endif // SUBTASKTABLE_H
